package com.kangtu.demolistener01.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: demo-weix-pay
 * @description: MainController
 * @author: 亮子说编程
 * @create: 2021-03-08 18:43
 **/
@RestController
public class MainController {

    @GetMapping(value = "/getUser")
    public Object getUser(HttpServletRequest request) {
        Integer count = (Integer) request.getSession().getServletContext().getAttribute("count");
        return "当前在线人数：" + count;
    }
}
